<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ include file="/common/includes.jsp" %>
<html xmlns="http://www.w3.org/1999/xhtml">
  <head>
    <title>权限管理</title>
	<!-- import css and js --> 
	<%@ include file="/common/metaInput.jsp" %>  
<script type="text/javascript">

$(function(){
$("#inputForm").validate({			   
	onsubmit: true,
	 /*执行ajaxsubmit  */ 
    submitHandler: function(editform) {
    	try{
    		var api = frameElement.api;
        	var W = api.opener;
    		var url="${ctx}/security/permiss/save.do"
            getReturnMessage(url,"inputForm",W.searchAP);	
        }catch(e){alert(e)}
    }
 }
);
})
function submitForm(param){
	
    //设置ajax全局同步
	jQuery.ajaxSettings.async = false;
  	$("#submitFlag").val(param);
    $("#inputForm").submit();
 }		
		
	
</script>

</head>

<body>

<form id="inputForm" action="${ctx}/security/permiss/save.do" method="post">
<input type="hidden" id="id" name="id" value="${permission.id}"/>
<!-- 用于标识提交按钮 -->
<input type="hidden" id="submitFlag" value="" />
 <div class="pageContent" >
    <div class="panel">
         <table class="TableBlock" align="center">
                
                   <tr>
   		                 <td nowrap>权限名称:</td>
   		                 <td colspan="3"><input id="name" style="width: 99%" <c:if test="${!empty permission.id}">readonly="readonly"</c:if>    name="name" class="required" value="${permission.name}" /></td>
   		               
   		           </tr>
   		            <tr>
   		              <td nowrap>权限描述:</td>
   		                 <td colspan="3">
   		                 <input id="description" style="width: 99%" name="description" class="required" value="${permission.description}" />
   		                 </td>	
   		            </tr>
   		             <tr>
   		                 <td nowrap>权限类型:</td>
   		                 <td >
   		                 <input type="hidden" id="action" name="action" value="view" readonly="readonly"/>
   		                 <select  id="type"   <c:if test="${!empty permission.id}">disabled="disabled"</c:if>  class="required" name="type" >
   		                    <option value="com.byd.acegiext.domain.UrlPermission"  >页面链接</option>
   		                 	<option value="com.byd.acegiext.domain.WebResourcePermission" <c:if test="${!empty permission && permission.type.name=='com.byd.acegiext.domain.WebResourcePermission'}">selected="selected"</c:if>>页面资源</option>
						</select>
   		             
   		                 
   		                 </td>
   		           		  <td nowrap></td>
   		                 <td ></td>
   		          
   		           </tr>
                 
   		         
                </table>               
         </div>
         <div class="formBar">
	        <ul>
		       <li><div class="buttonActive"><div class="buttonContent"><button type="button" id="save" onclick="submitForm(1)">保存</button></div></div></li>
		       <li><div class="button"><div class="buttonContent"><button type="button" class="print" onclick="CloseDialog()">关闭</button></div></div></li>
	        </ul>
        </div>    
    </div>
</form>
</body>
</html>
